<template>
	<view>
	<!-- 	<cu-custom bgColor="bg-gradual-blue" :isBack="false"><block slot="content">考试结束</block></cu-custom> -->
		<view class="cu-card case">
			<view class="cu-list menu">
				<view class="cu-item">
					<view class="content">
						<text class="cuIcon-warn text-green"></text>
						<text class="text-grey">考试名称</text>
					</view>
					<view class="action">
						<view class="cu-tag round bg-olive light">{{ resultinfo.name }}</view>
					</view>
				</view>
				<view class="cu-item">
					<view class="content">
						<text class="cuIcon-warn text-green"></text>
						<text class="text-grey">试卷标题</text>
					</view>
					<view class="action">
						<view class="cu-tag round bg-olive light">{{ resultinfo.titile }}</view>
					</view>
				</view>
				<view class="cu-item">
					<view class="content">
						<text class="cuIcon-tagfill text-red  margin-right-xs"></text>
						<text class="text-grey">考试得分</text>
					</view>
					<view class="action">
						<view class="cu-tag round bg-orange light">{{ resultinfo.fraction }}分</view>
					</view>
				</view>
				<view class="cu-item">
					<view class="content">
						<text class="cuIcon-warn text-green"></text>
						<text class="text-grey">评卷方式</text>
					</view>
					<view class="action">
						<view class="cu-tag round bg-olive light">{{ resultinfo.hascompletion }}</view>
					</view>
				</view>
				<view class="cu-item">
					<view class="content">
						<text class="cuIcon-warn text-green"></text>
						<text class="text-grey">最终结果</text>
					</view>
					<view class="action">
						<view class="cu-tag round bg-olive light">{{ resultinfo.result }}</view>
					</view>
				</view>
			</view>
		</view>
		<view><button class="cu-btn bg-red margin-tb-sm lg" @click="closeHtml" style="width: 100%;">关闭界面</button></view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			resultinfo:{}
		};
	},
	methods: {
		initInfo: function() {
			let data = this.info;
			data = encodeURI(JSON.stringify(data));
			uni.request({
				url: '/examonline/mobile/doResult',
				data: {
					data
				},
				dataType: 'post',
				success: resp => {
					let resdata = JSON.parse(resp.data);
					this.resultinfo = resdata.data;
				}
			});
		},closeHtml:function(){
			uni.reLaunch({
				url: '../main/main'
			});
		}
	},
	onLoad(info) {
		this.info = info;
	},
	onReady() {
		this.initInfo();
	}
};
</script>

<style></style>
